﻿<%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="Basket.aspx.cs"
    Inherits="Basket" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">
    <h2>
        <%=Resources.Language.Basket %></h2>
    <%-- <a href="#" onclick="clearBasket(); return false;">Opróżnij</a>--%>
    <div id="basketSite">
        <div id="grid">
            <center>
                <asp:GridView ID="dgvBasketItems" runat="server" AutoGenerateColumns="False" OnDataBound="dgvBasketItems_DataBound"
                    BorderStyle="none" GridLines="None" CssClass="basket-grid">
                    <Columns>
                        <asp:TemplateField HeaderText='<%$ Resources:Language,Name %>'>
                            <ItemTemplate>
                                <a href='<%#Eval("ProductID")%>,<%=Resources.Language.Product.ToLower() %>.aspx'>
                                    <%#Eval("Name")%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="PriceBrutto" HeaderText='<%$Resources:Language,Price %>'
                            ReadOnly="True" />
                        <asp:BoundField DataField="PriceNetto" HeaderText="&nbsp;<%$Resources:Language,PriceWithoutVAT %>&nbsp;"
                            ReadOnly="True" />
                        <asp:TemplateField HeaderText="&nbsp;<%$Resources:Language,Amount %>&nbsp;">
                            <ItemTemplate>
                                <asp:TextBox ID="txtCount" runat="server" Enabled="true"    Text="<%# (Container.DataItem as ShopModel.BasketItem).Count %>"  AutoPostBack="false">
                                </asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$Resources:Language, SumWithCurrency%>" >
                            <ItemTemplate>
                                <%#  (Container.DataItem as ShopModel.BasketItem).SumBrutto.ToString("F2") + " (" + (Container.DataItem as ShopModel.BasketItem).SumNetto.ToString("F2") + " " + Resources.Language.WithoutVAT + ")"%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ProductId" />
                        <asp:TemplateField HeaderText="<%$Resources:Language,DeleteUpper %>">
                            <ItemTemplate>
                                <a id="lnkRemove<%# Eval("ProductId") %>" href="#" onclick="removeFromBasketOnGrid(this, <%# Eval("ProductId") %>);">
                                    <%=Resources.Language.DeleteUpper %></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="basket-grid-row" />
                    <AlternatingRowStyle CssClass="basket-grid-row-alternate" />
                </asp:GridView>
            </center>
        </div>
        <div id="sumAllPrice" style="text-align: center;">
            <asp:Label ID="lblSumPrice1" runat="server"><%=Resources.Language.TotalAmountInBasket+":" %></asp:Label>
            <asp:Label ID="lblSumPrice2" runat="server" Text=""></asp:Label>
        </div>
        <div id="navigate" style="text-align: center;">
            <asp:HyperLink ID="lbtnToCashDesk" runat="server"><%=Resources.Language.BasketToCachdesk%></asp:HyperLink>
            <asp:HyperLink ID="lbtnBackToShop" runat="server"><%=Resources.Language.Return %></asp:HyperLink>
        </div>
    </div>
</asp:Content>
